package com.lanxiao.cloud.gateway.dubbo;

import com.alibaba.csp.sentinel.adapter.dubbo.fallback.DubboFallback;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.alibaba.dubbo.rpc.Invocation;
import com.alibaba.dubbo.rpc.Invoker;
import com.alibaba.dubbo.rpc.Result;
import com.lanxiao.cloud.gateway.api.GatewayDubboApi;
import com.lanxiao.cloud.gateway.application.RouteDefinitionManager;
import org.apache.dubbo.config.annotation.DubboService;

/**
 * @author ：qiaoliang
 * @date ：2021-09-09
 */
@DubboService()
public class GatewayDubboController implements GatewayDubboApi {

  private final RouteDefinitionManager routeDefinitionManager;

  public GatewayDubboController(
      RouteDefinitionManager routeDefinitionManager) {
    this.routeDefinitionManager = routeDefinitionManager;
  }

  @Override
  public void resetGatewayRoute() {
    routeDefinitionManager.gatewayRouteInit();
  }

}
